
var http = require('http')

var ejs = require('ejs')

var app = require('./Model/router_server')

http.createServer(app).listen(8008)

//登录页面
app.get('/login',function (req,res) {

    console.log('login')

    ejs.renderFile('./static/form.ejs',{},function (err,data) {
        if (err) {
            console.log(err)
        }else {
            res.send(data)
        }
    })

})
//注册页面
app.get('/register',function (req,res) {

    console.log('register')

    res.send('register')

})
//执行登录
app.post('/dologin',function (req,res) {

    console.log(req.body)

    res.send("<script>alert('登录成功');history.back()</script>")

})